import { Redirect } from 'umi';
import { useAuth } from '../utils/utils';

export default (props) => {
    const isLogin  = useAuth();
    if (isLogin) {
        return <div className="auth">{props.children}</div>;
    } else {
        return <Redirect to="/login" />;
    }
};
